home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Palettes.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  8.4 KB  |  417 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Palettes.a
  3. ;
  4. ;    Contains:    Palette Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  21. __PALETTES__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'MixedMode.a'                                        ;
  30. ;        include 'QuickdrawText.a'                                    ;
  31.  
  32.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  33.     include 'Windows.a'
  34.     ENDIF
  35. ;        include 'Memory.a'                                            ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'OSUtils.a'                                    ;
  38. ;        include 'Controls.a'                                        ;
  39. ;            include 'Menus.a'                                        ;
  40.  
  41. pmCourteous                        EQU        0                    ;Record use of color on each device touched.
  42. pmTolerant                        EQU        $0002                ;render ciRGB if ciTolerance is exceeded by best match.
  43. pmAnimated                        EQU        $0004                ;reserve an index on each device touched and render ciRGB.
  44. pmExplicit                        EQU        $0008                ;no reserve, no render, no record; stuff index into port.
  45. pmWhite                            EQU        $0010
  46. pmBlack                            EQU        $0020
  47. pmInhibitG2                        EQU        $0100
  48. pmInhibitC2                        EQU        $0200
  49. pmInhibitG4                        EQU        $0400
  50. pmInhibitC4                        EQU        $0800
  51. pmInhibitG8                        EQU        $1000
  52. pmInhibitC8                        EQU        $2000
  53. ; NSetPalette Update Constants 
  54. pmNoUpdates                        EQU        $8000                ;no updates
  55. pmBkUpdates                        EQU        $A000                ;background updates only
  56. pmFgUpdates                        EQU        $C000                ;foreground updates only
  57. pmAllUpdates                    EQU        $E000                ;all updates
  58.  
  59. ColorInfo                 RECORD    0
  60. ciRGB                     ds     RGBColor ; offset: $0 (0)        ;true RGB values
  61. ciUsage                     ds.w   1        ; offset: $6 (6)        ;color usage
  62. ciTolerance                 ds.w   1        ; offset: $8 (8)        ;tolerance value
  63. ciDataFields             ds.w   3        ; offset: $A (10)        ;private fields
  64. sizeof                     EQU *            ; size:   $10 (16)
  65.                         ENDR
  66.  
  67. ; typedef struct ColorInfo     ColorInfo
  68. Palette                 RECORD    0
  69. pmEntries                 ds.w   1        ; offset: $0 (0)        ;entries in pmTable
  70. pmDataFields             ds.w   7        ; offset: $2 (2)        ;private fields
  71. pmInfo                     ds     ColorInfo ; offset: $10 (16)
  72. sizeof                     EQU *            ; size:   $20 (32)
  73.                         ENDR
  74.  
  75. ; typedef struct Palette     Palette, *PalettePtr, **PaletteHandle
  76. ;
  77. ; pascal void InitPalettes(void)
  78. ;
  79.     IF ¬ GENERATINGCFM THEN
  80.         _InitPalettes:    OPWORD    $AA90
  81.     ELSE
  82.         IMPORT_CFM_FUNCTION    InitPalettes
  83.     ENDIF
  84.  
  85. ;
  86. ; pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
  87. ;
  88.     IF ¬ GENERATINGCFM THEN
  89.         _NewPalette:    OPWORD    $AA91
  90.     ELSE
  91.         IMPORT_CFM_FUNCTION    NewPalette
  92.     ENDIF
  93.  
  94. ;
  95. ; pascal PaletteHandle GetNewPalette(short PaletteID)
  96. ;
  97.     IF ¬ GENERATINGCFM THEN
  98.         _GetNewPalette:    OPWORD    $AA92
  99.     ELSE
  100.         IMPORT_CFM_FUNCTION    GetNewPalette
  101.     ENDIF
  102.  
  103. ;
  104. ; pascal void DisposePalette(PaletteHandle srcPalette)
  105. ;
  106.     IF ¬ GENERATINGCFM THEN
  107.         _DisposePalette:    OPWORD    $AA93
  108.     ELSE
  109.         IMPORT_CFM_FUNCTION    DisposePalette
  110.     ENDIF
  111.  
  112. ;
  113. ; pascal void ActivatePalette(WindowPtr srcWindow)
  114. ;
  115.     IF ¬ GENERATINGCFM THEN
  116.         _ActivatePalette:    OPWORD    $AA94
  117.     ELSE
  118.         IMPORT_CFM_FUNCTION    ActivatePalette
  119.     ENDIF
  120.  
  121. ;
  122. ; pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
  123. ;
  124.     IF ¬ GENERATINGCFM THEN
  125.         _SetPalette:    OPWORD    $AA95
  126.     ELSE
  127.         IMPORT_CFM_FUNCTION    SetPalette
  128.     ENDIF
  129.  
  130. ;
  131. ; pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
  132. ;
  133.     IF ¬ GENERATINGCFM THEN
  134.         _NSetPalette:    OPWORD    $AA95
  135.     ELSE
  136.         IMPORT_CFM_FUNCTION    NSetPalette
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  141. ;
  142.     IF ¬ GENERATINGCFM THEN
  143.         _GetPalette:    OPWORD    $AA96
  144.     ELSE
  145.         IMPORT_CFM_FUNCTION    GetPalette
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
  150. ;
  151.     IF ¬ GENERATINGCFM THEN
  152.         _CopyPalette:    OPWORD    $AAA1
  153.     ELSE
  154.         IMPORT_CFM_FUNCTION    CopyPalette
  155.     ENDIF
  156.  
  157. ;
  158. ; pascal void PmForeColor(short dstEntry)
  159. ;
  160.     IF ¬ GENERATINGCFM THEN
  161.         _PmForeColor:    OPWORD    $AA97
  162.     ELSE
  163.         IMPORT_CFM_FUNCTION    PmForeColor
  164.     ENDIF
  165.  
  166. ;
  167. ; pascal void PmBackColor(short dstEntry)
  168. ;
  169.     IF ¬ GENERATINGCFM THEN
  170.         _PmBackColor:    OPWORD    $AA98
  171.     ELSE
  172.         IMPORT_CFM_FUNCTION    PmBackColor
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
  177. ;
  178.     IF ¬ GENERATINGCFM THEN
  179.         _AnimateEntry:    OPWORD    $AA99
  180.     ELSE
  181.         IMPORT_CFM_FUNCTION    AnimateEntry
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
  186. ;
  187.     IF ¬ GENERATINGCFM THEN
  188.         _AnimatePalette:    OPWORD    $AA9A
  189.     ELSE
  190.         IMPORT_CFM_FUNCTION    AnimatePalette
  191.     ENDIF
  192.  
  193. ;
  194. ; pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
  195. ;
  196.     IF ¬ GENERATINGCFM THEN
  197.         _GetEntryColor:    OPWORD    $AA9B
  198.     ELSE
  199.         IMPORT_CFM_FUNCTION    GetEntryColor
  200.     ENDIF
  201.  
  202. ;
  203. ; pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
  204. ;
  205.     IF ¬ GENERATINGCFM THEN
  206.         _SetEntryColor:    OPWORD    $AA9C
  207.     ELSE
  208.         IMPORT_CFM_FUNCTION    SetEntryColor
  209.     ENDIF
  210.  
  211. ;
  212. ; pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
  213. ;
  214.     IF ¬ GENERATINGCFM THEN
  215.         _GetEntryUsage:    OPWORD    $AA9D
  216.     ELSE
  217.         IMPORT_CFM_FUNCTION    GetEntryUsage
  218.     ENDIF
  219.  
  220. ;
  221. ; pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
  222. ;
  223.     IF ¬ GENERATINGCFM THEN
  224.         _SetEntryUsage:    OPWORD    $AA9E
  225.     ELSE
  226.         IMPORT_CFM_FUNCTION    SetEntryUsage
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
  231. ;
  232.     IF ¬ GENERATINGCFM THEN
  233.         _CTab2Palette:    OPWORD    $AA9F
  234.     ELSE
  235.         IMPORT_CFM_FUNCTION    CTab2Palette
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
  240. ;
  241.     IF ¬ GENERATINGCFM THEN
  242.         _Palette2CTab:    OPWORD    $AAA0
  243.     ELSE
  244.         IMPORT_CFM_FUNCTION    Palette2CTab
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal long Entry2Index(short entry)
  249. ;
  250.     IF ¬ GENERATINGCFM THEN
  251.         Macro
  252.         _Entry2Index
  253.             moveq    #0,d0
  254.             dc.w     $AAA2
  255.         EndM
  256.     ELSE
  257.         IMPORT_CFM_FUNCTION    Entry2Index
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal void RestoreDeviceClut(GDHandle gd)
  262. ;
  263.     IF ¬ GENERATINGCFM THEN
  264.         Macro
  265.         _RestoreDeviceClut
  266.             moveq    #2,d0
  267.             dc.w     $AAA2
  268.         EndM
  269.     ELSE
  270.         IMPORT_CFM_FUNCTION    RestoreDeviceClut
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal void ResizePalette(PaletteHandle p, short size)
  275. ;
  276.     IF ¬ GENERATINGCFM THEN
  277.         Macro
  278.         _ResizePalette
  279.             moveq    #3,d0
  280.             dc.w     $AAA2
  281.         EndM
  282.     ELSE
  283.         IMPORT_CFM_FUNCTION    ResizePalette
  284.     ENDIF
  285.  
  286. ;
  287. ; pascal void SaveFore(ColorSpec *c)
  288. ;
  289.     IF ¬ GENERATINGCFM THEN
  290.         Macro
  291.         _SaveFore
  292.             move.w    #$040D,d0
  293.             dc.w     $AAA2
  294.         EndM
  295.     ELSE
  296.         IMPORT_CFM_FUNCTION    SaveFore
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal void SaveBack(ColorSpec *c)
  301. ;
  302.     IF ¬ GENERATINGCFM THEN
  303.         Macro
  304.         _SaveBack
  305.             move.w    #$040E,d0
  306.             dc.w     $AAA2
  307.         EndM
  308.     ELSE
  309.         IMPORT_CFM_FUNCTION    SaveBack
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal void RestoreFore(const ColorSpec *c)
  314. ;
  315.     IF ¬ GENERATINGCFM THEN
  316.         Macro
  317.         _RestoreFore
  318.             move.w    #$040F,d0
  319.             dc.w     $AAA2
  320.         EndM
  321.     ELSE
  322.         IMPORT_CFM_FUNCTION    RestoreFore
  323.     ENDIF
  324.  
  325. ;
  326. ; pascal void RestoreBack(const ColorSpec *c)
  327. ;
  328.     IF ¬ GENERATINGCFM THEN
  329.         Macro
  330.         _RestoreBack
  331.             move.w    #$0410,d0
  332.             dc.w     $AAA2
  333.         EndM
  334.     ELSE
  335.         IMPORT_CFM_FUNCTION    RestoreBack
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
  340. ;
  341.     IF ¬ GENERATINGCFM THEN
  342.         Macro
  343.         _SetDepth
  344.             move.w    #$0A13,d0
  345.             dc.w     $AAA2
  346.         EndM
  347.     ELSE
  348.         IMPORT_CFM_FUNCTION    SetDepth
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
  353. ;
  354.     IF ¬ GENERATINGCFM THEN
  355.         Macro
  356.         _HasDepth
  357.             move.w    #$0A14,d0
  358.             dc.w     $AAA2
  359.         EndM
  360.     ELSE
  361.         IMPORT_CFM_FUNCTION    HasDepth
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal short PMgrVersion(void)
  366. ;
  367.     IF ¬ GENERATINGCFM THEN
  368.         Macro
  369.         _PMgrVersion
  370.             moveq    #21,d0
  371.             dc.w     $AAA2
  372.         EndM
  373.     ELSE
  374.         IMPORT_CFM_FUNCTION    PMgrVersion
  375.     ENDIF
  376.  
  377. ;
  378. ; pascal void SetPaletteUpdates(PaletteHandle p, short updates)
  379. ;
  380.     IF ¬ GENERATINGCFM THEN
  381.         Macro
  382.         _SetPaletteUpdates
  383.             move.w    #$0616,d0
  384.             dc.w     $AAA2
  385.         EndM
  386.     ELSE
  387.         IMPORT_CFM_FUNCTION    SetPaletteUpdates
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal short GetPaletteUpdates(PaletteHandle p)
  392. ;
  393.     IF ¬ GENERATINGCFM THEN
  394.         Macro
  395.         _GetPaletteUpdates
  396.             move.w    #$0417,d0
  397.             dc.w     $AAA2
  398.         EndM
  399.     ELSE
  400.         IMPORT_CFM_FUNCTION    GetPaletteUpdates
  401.     ENDIF
  402.  
  403. ;
  404. ; pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
  405. ;
  406.     IF ¬ GENERATINGCFM THEN
  407.         Macro
  408.         _GetGray
  409.             move.w    #$0C19,d0
  410.             dc.w     $AAA2
  411.         EndM
  412.     ELSE
  413.         IMPORT_CFM_FUNCTION    GetGray
  414.     ENDIF
  415.  
  416.     ENDIF ; __PALETTES__
  417.